Photon counting detector performance can be severely degraded at high X-ray flux due to uncontrollable and unpredictable changes in the baseline of the analogue signal of the photon counting detector and probed by the readout ASIC. These changes in the baseline can be induced, for example, by changes in the resistivity of the sensor material upon intense X-ray irradiation, changes in the electric field due to space charge or other effects in the semiconductor and can depend on the irradiation history as well.